<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery-3.7.1.min.js"></script>
</head>
<body>
<div id="result"></div>
<div><button onclick="doGet()">GET</button></div>
<div><button onclick="doPost()">POST</button></div>
<div><button onclick="doPut()">PUT</button></div>
<div><button onclick="doDelete()">DELETE</button></div>
<script>
    function doGet() {
        $.get("http://localhost:8080/book", function (data) {
            $("#result").html(data);
        });
    }
    function doPost() {
        $.post("http://localhost:8080/book", function (data) {
            $("#result").html(data);
        });
    }
    function doPut() {
        $.ajax({
            url:'http://localhost:8080/book',
            type:'put',
            success: function (data) {
                $("#result").html(data);
            },
        })
    }
    function doDelete() {
        $.ajax({
            url:'http://localhost:8080/book',
            type:'delete',
            success: function (data) {
                $("#result").html(data);
            },
        })
    }
</script>
</body>
</html>